export interface UserInfo {
  username: string
  name: string
  userId?: string
  avatarUrl?: string
  [key: string]: any
}

export interface AIAgent {
  id: string
  key: string
  name: string
  welcomeMessage?: any
  subTitle?: string
  icon?: string
  menuIcon?: string
  iconUrl?: string
  logoUrl?: string
  tag?: string
  prologue?: string
  [key: string]: any
}

export interface Conversion {
  conversionId: string
  conversionName: string
  agentInfo: AIAgent
  createTime?: string
  updateTime?: string
  [key: string]: any
}

export enum MessageType {
  Text = 'text',
  Image = 'image'
}

//枚举 对话的状态
export enum AIGCStatus {
  Idle = 'Idle', // 闲置
  Started = 'Started', // 开始
  InProgress = 'InProgress', // 进行中
  Canceled = 'Canceled', // 取消
  Completed = 'Completed', // 完成
  Error = 'Error' //回答出错
}

export interface ChatMessage {
  messageId: string
  messageType: MessageType
  isSend: boolean
  contentList: MessageContent[]
  msgContent?: MessageContent
  createTime?: string
  rowData?: any
  [key: string]: any
}

export interface MessageContent {
  contentType: MessageContentType
  content: any
  rowData: any
  [key: string]: any
}

export interface IMessageParser {
  taskStatusFromResp(respData: any): AIGCStatus
  contentRowDataListFromResp(respData: any): any[]
  sessionIdFromResp(respData: any): string
  isTypeWriterContent(content: any): boolean
  isSupportedContentType(content: any): boolean
  aigcTypeWriterContentCacheData(content: any): string
  messageContentWithRowData(contentItem: any): MessageContent
  messageListFromHistoryMessageResp(respData: any): ChatMessage[]
}

export enum MessageContentType {
  Text = 'text',
  Image = 'image',
  FormInput = 'form_input',
  FormOutput = 'form_output',
  Progress = 'progress',
  Recommend = 'recommend',
  Reference = 'reference'
}
